<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./lib/bootstrap-v4.6.0.css">
  <link rel="stylesheet" href="./lib/throttle.css">
</head>

<body>

 <button>点击获取图书数据,弹窗显示获取成功</button>
 <script src="./lib/jquery-v3.6.0.js"></script>
   <script src="./lib/axios.js"></script>
  <script>
   let key;
   $("button").click(function(){
     if(key == "请求中")
     return;

     key ="请求中";

     axios.get('http://www.liulongbin.top:3009/api/getbooks')
     .then(({
       data:res
     }) =>{
       if(res.code == 200){
         key = "请求完"
         alert(res.msg)
       }
     })
   })
  </script>
</body>

</html>